<?php


namespace app\modules\Merchant\models;

class bannerModel extends \Illuminate\Database\Eloquent\Model
{
    protected $table = 'dianpu_banner';
    protected $primaryKey = 'id';
    protected $appends = ['status_name'];

    protected static $ALLSTATUS = [
        0=>'已隐藏',
        1=>'显示中',
    ];

    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i:s');
    }

    public function getStatusNameAttribute($value)
    {
        return self::$ALLSTATUS[$this->attributes['status']]??'未知';
    }

    public static function getAllStatus()
    {
        return self::$ALLSTATUS;
    }
}